#include <iostream>
#include <string>

using namespace std;

class person
{
public:
    string name;
    string sex;
    int age;
public:
    person() {}
    person(string name, string sex, int age) : name(name), sex(sex), age(age) {}
    ~person(){}
public:
    void show()
    {
        cout << "名字:" << name << " 性别:" << sex << " 年龄:" << age << endl;
    }
};

class student : public person
{
public:
    int id;
    int soc;
public:
    student() {}
    student(string name, string sex, int age, int id, int soc):
        person(name, sex, age), id(id), soc(soc) {}
    ~student(){}
public:
    void show()
    {
        cout << "名字:" << person::name << " 性别:" << person::sex << " 年龄:" << person::age << " 学号:" << id << " 成绩:" << soc << endl;
    }
};

int main(int argc, char const *argv[])
{
    student s1("刘欢","女",18,1,99);
    s1.show();

    s1.person::show(); // 类外调用函数
    s1.person::name = "李四"; // 类外调用 父类 的成员变量

    s1.show();
    
    return 0;
}
